package me.itsoo.artemis.framework.repository.mapper;

import me.itsoo.artemis.framework.repository.executor.BoundSql;
import me.itsoo.artemis.framework.repository.mapper.condition.AbstractCondition;
import me.itsoo.artemis.framework.repository.mapper.resource.AbstractResource;

/**
 * MapperBoundSqlFactory
 *
 * @author zxy
 * @version 0.0.1
 * @since 2023/5/18
 */
public interface MapperBoundSqlFactory {

    /**
     * 获取 BoundSql
     *
     * @param res  AbstractResource
     * @param cond AbstractCondition
     * @return BoundSql
     */
    BoundSql getBoundSql(AbstractResource res, AbstractCondition cond);

    /**
     * 获取 BoundSql
     *
     * @param res AbstractResource
     * @return BoundSql
     */
    default BoundSql getBoundSql(AbstractResource res) {
        return getBoundSql(res, null);
    }

    /**
     * 获取 BoundSql
     *
     * @param cond AbstractCondition
     * @return BoundSql
     */
    default BoundSql getBoundSql(AbstractCondition cond) {
        return getBoundSql(null, cond);
    }
}
